package edu.zju.udms.dnavigator.core.server.servlets;

import java.util.HashMap;
import java.util.UUID;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import edu.zju.udms.dnavigator.core.config.Configuration;
import edu.zju.udms.dnavigator.core.extract.Extractor;
import edu.zju.udms.dnavigator.core.repository.Repository;

public class NavigatorServlet extends HttpServlet{
	private static final long serialVersionUID = 7320604357919811436L;
	protected Repository repository;
	protected Configuration config;
	protected HashMap<UUID, Extractor> extractorMap = new HashMap<>();
	
	@Override
	public void init(ServletConfig config) throws ServletException {
		ServletContext ctx = config.getServletContext();
		this.repository = (Repository) ctx.getAttribute("repository");
		this.config = (Configuration) ctx.getAttribute("config");

		this.init();
	}
}
